programming4us
           
 
 
Windows

Windows 7 : Checking Free Disk Space

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
11/25/2010 4:26:24 PM
Hard disks with capacities measured in the hundreds of gigabytes are commonplace even in low-end systems nowadays, so disk space is much less of a problem than it used to be. Still, you need to keep track of how much free space you have on your disk drives, particularly the %SystemDrive% (usually the C: drive), which usually stores the virtual memory page file.

One way to check disk free space is to view the Computer folder using either the Tiles or Content views, which include the free space and total disk space with each drive icon, or the Details view, which includes columns for Total Size and Free Space, as shown in Figure 1. Alternatively, right-click the drive in Windows Explorer and then click Properties. The disk’s total capacity, as well as its current used and free space, appear in the General tab of the disk’s property sheet.

Figure 1. Display the Computer folder in Details view to see the total size and free space on your system’s disks.


Tip

To see the File System and Percent Full columns shown in Figure 1, right-click any column header and then click the File System property, then repeat and click the Percent Full property.


Listing 7.1 presents a VBScript procedure that displays the status and free space for each drive on your system.

Note

To get the file with the Listing 1 code—it’s called DriveStatusAndSpace.vbs—see my website: www.mcfedries.com/Windows7Unleashed.


Listing 1. A VBScript Example That Displays the Status and Free Space for Your System’s Drives
Option Explicit
Dim objFSO, colDiskDrives, objDiskDrive, strMessage

' Create the File System Object
Set objFSO = CreateObject("Scripting.FileSystemObject")

' Get the collection of disk drives
Set colDiskDrives = objFSO.Drives

' Run through the collection
strMessage = "Disk Drive Status Report" & vbCrLf & vbCrLf
For Each objDiskDrive in colDiskDrives

' Add the drive letter to the message
strMessage = strMessage & "Drive: " & objDiskDrive.DriveLetter & vbCrLf
' Check the drive status
If objDiskDrive.IsReady = True Then

' If it's ready, add the status and the free space to the message
strMessage = strMessage & "Status: Ready" & vbCrLf
strMessage = strMessage & "Free space: " & objDiskDrive.FreeSpace
strMessage = strMessage & vbCrLf & vbCrLf
Else

' Otherwise, just add the status to the message
strMessage = strMessage & "Status: Not Ready" & vbCrLf & vbCrLf
End If
Next

' Display the message
Wscript.Echo strMessage


This script creates a FileSystemObject and then uses its Drives property to return the system’s collection of disk drives. Then a For Each...Next loop runs through the collection, gathering the drive letter, the status, and, if the disk is ready, the free space. It then displays the drive data as shown in Figure 2.

Figure 2. The script displays the status and free space for each drive on your system.

Other -----------------
- Windows 7 : Checking Your Hard Disk for Errors
- Windows Azure : Understanding Message Operations
- Windows Azure : Understanding Queue Operations
- Windows Azure Queue Overview
- Tuning Windows 7’s Performance : Optimizing Virtual Memory
- Tuning Windows 7’s Performance : Optimizing the Hard Disk
- Tuning Windows 7’s Performance : Optimizing Applications
- Tuning Windows 7’s Performance : Optimizing Startup
- Tuning Windows 7’s Performance : Monitoring Performance
- Windows Vista - File Encryption : Workings of BitLocker Drive Encryption
- Windows Vista - File Encryption : Encryption File System
- Windows 7 : Customizing the Taskbar for Easier Program and Document Launching
- Windows 7 : Customizing the Start Menu for Easier Program and Document Launching
- Windows Azure Storage : REST API (part 2) - Storage Client APIs
- Windows Azure Storage : REST API (part 1)
- Windows 7 : Customizing Your Notebook’s Power and Sleep Buttons
- Windows 7 : Customizing the Start Menu’s Power Button
- Windows 7 : Turning Off Your Windows 7 Computer from Anywhere
- Windows 7 : Setting Up One-Click Restarts and Shutdowns
- Windows 7 : Useful Windows 7 Logon Strategies
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us